<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en-us" xml:lang="en-us">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="DC.Type" content="topic">
  <meta name="DC.Title" content="Checking and Configuring the Archive Mode of the Oracle Database">
  <meta name="product" content="">
  <meta name="DC.Relation" scheme="URI" content="oracle_gud_0015.html">
  <meta name="prodname" content="">
  <meta name="version" content="">
  <meta name="brand" content="30-OceanProtect Appliance 1.5.0-1.6.0 Help Center">
  <meta name="DC.Publisher" content="20241029">
  <meta name="prodname" content="csbs">
  <meta name="documenttype" content="usermanual">
  <meta name="DC.Format" content="XHTML">
  <meta name="DC.Identifier" content="oracle_gud_0017">
  <meta name="DC.Language" content="en-us">
  <link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
  <title>Checking and Configuring the Archive Mode of the Oracle Database</title>
 </head>
 <body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px">
  <a name="oracle_gud_0017"></a><a name="oracle_gud_0017"></a>
  <h1 class="topictitle1">Checking and Configuring the Archive Mode of the Oracle Database</h1>
  <div>
   <p>Before performing a backup, you must enable the archive mode of the Oracle database.</p>
   <div class="section">
    <h4 class="sectiontitle">Prerequisites</h4>
    <ul>
     <li>If the archive logs of the Oracle database are stored in the flash recovery area, the production environment will be abnormal when space of the area is used up. Ensure that the flash recovery area has sufficient space for storing archive logs generated in five days and monitor the space usage of the flash recovery area in real time.</li>
     <li>If the archive logs of the Oracle database are stored in a local path, ensure that the Oracle database installation user (<strong>oracle</strong> by default) has the read and write permissions for the archive path and that the directory where the archive path is located has available space.</li>
    </ul>
   </div>
   <div class="section">
    <h4 class="sectiontitle">Procedure</h4>
    <ol>
     <li><span>Log in to the Oracle database host.</span><p></p>
      <ul id="oracle_gud_0017__oracle_gud_0020_en-us_topic_0000001656760969_ul1983714162204">
       <li id="oracle_gud_0017__oracle_gud_0020_en-us_topic_0000001656760969_li7258697580">If the Linux OS is used, use PuTTY to log in to the Oracle database host and run the <strong id="oracle_gud_0017__oracle_gud_0020_b14682476107">su - oracle</strong> command to switch to user <strong id="oracle_gud_0017__oracle_gud_0020_b1646874718106">oracle</strong>.</li>
       <li id="oracle_gud_0017__oracle_gud_0020_en-us_topic_0000001656760969_li1366015032013">If the Windows OS is used, log in to the Oracle database host as the system administrator.</li>
      </ul> <p></p></li>
     <li><span>Run the following commands to log in to the Oracle database instance.</span><p></p>
      <ul id="oracle_gud_0017__oracle_gud_0016_ul7420345341">
       <li id="oracle_gud_0017__oracle_gud_0016_li15682124913711">OS authentication:
        <ul id="oracle_gud_0017__oracle_gud_0016_ul89443983816">
         <li id="oracle_gud_0017__oracle_gud_0016_li18420124173415">If the Linux OS is used, run the following commands:<p id="oracle_gud_0017__oracle_gud_0016_p95148598366"><a name="oracle_gud_0017__oracle_gud_0016_li18420124173415"></a><a name="oracle_gud_0016_li18420124173415"></a><strong id="oracle_gud_0017__oracle_gud_0016_b14236563719">export ORACLE_SID=</strong><em id="oracle_gud_0017__oracle_gud_0016_i85144598369">Database instance name</em></p> <p id="oracle_gud_0017__oracle_gud_0016_p145141259153613"><strong id="oracle_gud_0017__oracle_gud_0016_b1597618293715">sqlplus / as sysdba</strong></p></li>
         <li id="oracle_gud_0017__oracle_gud_0016_li7402151163816">If the Windows OS is used, perform the following operations:
          <ol type="a" id="oracle_gud_0017__oracle_gud_0016_ol124110408264">
           <li id="oracle_gud_0017__oracle_gud_0016_li624120402267">Press <span class="uicontrol" id="oracle_gud_0017__oracle_gud_0016_oracle_gud_0016_uicontrol11819941114510"><b>Win+R</b></span> to open the <strong id="oracle_gud_0017__oracle_gud_0016_oracle_gud_0016_b1015191219408">Run</strong> window.</li>
           <li id="oracle_gud_0017__oracle_gud_0016_li161821338277">Enter <span class="parmvalue" id="oracle_gud_0017__oracle_gud_0016_parmvalue122291222476"><b>cmd</b></span> and run the following commands:<p id="oracle_gud_0017__oracle_gud_0016_p1755152313372"><strong id="oracle_gud_0017__oracle_gud_0016_b19591532143713">set ORACLE_SID=</strong><em id="oracle_gud_0017__oracle_gud_0016_i16755423133718">Database instance name</em></p> <p id="oracle_gud_0017__oracle_gud_0016_p1075515234379"><strong id="oracle_gud_0017__oracle_gud_0016_b540852910371">sqlplus / as sysdba</strong></p></li>
          </ol></li>
        </ul></li>
       <li id="oracle_gud_0017__oracle_gud_0016_li105571236103417">Database authentication:
        <ul id="oracle_gud_0017__oracle_gud_0016_ul1136516538386">
         <li id="oracle_gud_0017__oracle_gud_0016_li1723334817382">If the Linux OS is used, run the following commands:<p id="oracle_gud_0017__oracle_gud_0016_p920984963717"><a name="oracle_gud_0017__oracle_gud_0016_li1723334817382"></a><a name="oracle_gud_0016_li1723334817382"></a><strong id="oracle_gud_0017__oracle_gud_0016_b162511338427">export ORACLE_SID=</strong><em id="oracle_gud_0017__oracle_gud_0016_i142521037423">Database instance name</em></p> <p id="oracle_gud_0017__oracle_gud_0016_p182093496371"><strong id="oracle_gud_0017__oracle_gud_0016_b034785743716">sqlplus</strong></p> <p id="oracle_gud_0017__oracle_gud_0016_p17915722412">Enter the name of a user with the <strong id="oracle_gud_0017__oracle_gud_0016_b0440649114212">sysdba</strong> permissions as prompted:</p> <pre class="screen" id="oracle_gud_0017__oracle_gud_0016_screen9915112104114"><em id="oracle_gud_0017__oracle_gud_0016_i1915102164113">username </em>as sysdba</pre> <p id="oracle_gud_0017__oracle_gud_0016_p159150224117">Enter the password as prompted.</p></li>
         <li id="oracle_gud_0017__oracle_gud_0016_li122822426407">If the Windows OS is used, perform the following operations:
          <ol type="a" id="oracle_gud_0017__oracle_gud_0016_ol587720252273">
           <li id="oracle_gud_0017__oracle_gud_0016_li5168124414479">Press <span class="uicontrol" id="oracle_gud_0017__oracle_gud_0016_oracle_gud_0016_uicontrol11819941114510_1"><b>Win+R</b></span> to open the <strong id="oracle_gud_0017__oracle_gud_0016_oracle_gud_0016_b1015191219408_1">Run</strong> window.</li>
           <li id="oracle_gud_0017__oracle_gud_0016_li3877172517270">Enter <span class="parmvalue" id="oracle_gud_0017__oracle_gud_0016_parmvalue89061315114212"><b>cmd</b></span> and run the following commands:<p id="oracle_gud_0017__oracle_gud_0016_p8745723103813"><strong id="oracle_gud_0017__oracle_gud_0016_b0361183517422">set ORACLE_SID=</strong><em id="oracle_gud_0017__oracle_gud_0016_i8361163518426">Database instance name</em></p> <p id="oracle_gud_0017__oracle_gud_0016_p15745182333814"><strong id="oracle_gud_0017__oracle_gud_0016_b11154427163811">sqlplus</strong></p> <p id="oracle_gud_0017__oracle_gud_0016_p71274192512">Enter the name of a user with the <strong id="oracle_gud_0017__oracle_gud_0016_b330420012221">sysdba</strong> permissions as prompted:</p> <pre class="screen" id="oracle_gud_0017__oracle_gud_0016_screen18896121620243"><em id="oracle_gud_0017__oracle_gud_0016_i380114413256">username </em>as sysdba</pre> <p id="oracle_gud_0017__oracle_gud_0016_p15251105852511">Enter the password as prompted.</p></li>
          </ol></li>
        </ul></li>
      </ul> <p></p></li>
     <li><span>Run the following command to check whether the archive mode is enabled:</span><p></p><p><strong>archive log list;</strong></p> <p>If information similar to the following is displayed, the archive mode has been enabled:</p> <pre class="screen">SQL&gt; archive log list;
<strong>Database log mode              Archive Mode</strong>
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     19
Next log sequence to archive   21
Current log sequence           21</pre> <p></p></li>
     <li><span>If the archive mode is not enabled, run commands to enable the archive mode.</span><p></p>
      <ul>
       <li>In a single-node system, run the following commands:
        <div class="note">
         <img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span>
         <div class="notebody">
          <p>The database is shut down when the database archive mode is enabled. This operation may cause service interruption. Therefore, you need to take the service interruption time into account before performing this operation.</p>
         </div>
        </div> <pre class="screen"><strong>shutdown immediate;</strong>
<strong>startup mount;</strong>
<strong>alter database archivelog;</strong>
<strong>alter database open;</strong></pre></li>
       <li>In the RAC cluster scenario, run the following commands on each node. For an ASM instance, set <em>Path for storing archive logs</em> to the ASM shared disk group path.<pre class="screen">shutdown immediate;
startup mount;
alter system set log_archive_dest_1='location=<em>Path for storing archive logs</em>';
alter database archivelog;
alter database open;</pre></li>
      </ul> <p></p></li>
    </ol>
   </div>
  </div>
  <div>
   <div class="familylinks">
    <div class="parentlink">
     <strong>Parent topic:</strong> <a href="oracle_gud_0015.html">Step 1: Checking and Configuring the Database Environment</a>
    </div>
   </div>
  </div>
 </body>
</html>